package com.oocl.euc.core.maintenance.model;

import com.oocl.euc.audit.AuditEntity;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "PCRS_APP_KEY")
@SequenceGenerator(name = "SEQUENCE_GENERATOR", sequenceName = "APP_KEY_SEQUENCE", allocationSize = 1)
public class ApplicationKey extends AuditEntity {

    @Column(name = "APP_KEY")
    private String appKey;

    @Column(name = "DEFAULT_VALUE")
    private String defaultValue;

    @Column(name = "DESCRIPTION", columnDefinition = "CLOB")
    private String description;


    @OneToMany(cascade = {CascadeType.ALL}, fetch = FetchType.EAGER, orphanRemoval = true)
    @JoinColumn(name = "APP_KEY_ID", referencedColumnName = "ID")
    private List<ApplicationKeyValue> applicationKeyValueList;

    public String getAppKey() {
        return appKey;
    }

    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<ApplicationKeyValue> getApplicationKeyValueList() {
        return applicationKeyValueList;
    }

    public void setApplicationKeyValueList(List<ApplicationKeyValue> applicationKeyValueList) {
        this.applicationKeyValueList = applicationKeyValueList;
    }
}
